<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:fragment="nav">
    <!-- 导航栏-->
    <div style="border:2px slateblue solid">
        <h2 align="center">基于SpringBoot2.7.x MyBatis2.3.x Thymeleaf 的学生成绩简易系统-Mark5</h2>
        <hr>
        <div style="display: flex; justify-content: space-between">
            <h4><a href="/mark5/go2login">学生成绩简易系统-首页</a></h4>
            <div  style="width: 50%; display: flex;  align-content: right;  justify-content: space-between; padding-top: 12px">
                <p th:if="${ session.user== null}" style="color: #aabec5">
                    未登录</p>
                <p  th:if="${ session.user!= null}"style="color: orangered">
                    已登录</p>
                <p style="color: blue" >姓名:
                    <span th:if="${session.user!=null}" th:text="${session.user.uname}"></span></p>
                <p style="color: blueviolet">角色:<span th:if="${session.user!=null}" th:text="${session.user.role}"></span></p>

                </div>
                <p style="color: blue"><a href="/mark5/logout.do">退出</a></p>
            <div th:if="${session.user!= null}" style="width: 5vw; height: 5vw">
            <img style="height: 90%; width: 100% " th:src="'/mark5/showimg/'+ ${session.user.pic}"/>
        </div>
            <p>&nbsp;</p>
            </div>
        </div>
        <!--<hr>-->
    </div>
    <!--导航栏结束-->

<div style="width: 30%; display: flex;" th:if="${info!=null}">
    <h2>消息提示:</h2>
    <h2  style="color: red" align="center"  th:text="${info}"></h2>
</div>

<span th:if="${session.info!=null}">
    <div style="width: 30%; display: flex;">
    <h2 >消息提示:</h2>
    <h2  style="color: red" align="center" th:text="${session.info}"></h2>
    </div>
</span>

    <!--登录窗口及功能窗口-->
    <div style="display: flex; justify-content: space-between">




        <!--登录窗口-->
        <div style="width: 35%; display: flex; justify-content: space-between">
            <div style="margin-left: 2%; width: 90%">
                <h3 align="center">登录</h3>

                <table  width="90%" border="1" cellspacing="0" style="line-height: 36px">
                    <form action='/mark5/login' method='post'>
                        <tr align="center">
                            <td>手机号:</td> <td><input type='text' name='phone'></td>
                        </tr>
                        <tr align="center">
                            <td>密码:</td><td><input type='text' name='pwd'></td>
                        </tr>
                        <tr align="center">
                            <td></td><td><input type='submit' value='登录'></td>
                        </tr>
                    </form>
                </table>
                <h4    style="color: red" align="center"  th:text="${err}"></h4>
            </div>
        </div>
        <!--登录窗口结束-->


        <!--功能窗口-->
        <div style="border: antiquewhite 1px solid; width: 60%">
            <!--管理员窗口-->
            <div  align="center" >
                <h3>管理员端- 管理员登录后方可操作</h3>
                <div th:if="${ session.user!= null && session.user.role=='adm'}">

                    <ul style="list-style: square">
                        <li><a href="/clz/show">班级管理</a></li>
                        <li><a href="/course/show">课程管理</a></li>
                        <li><a href="/stu/show">学生管理</a></li>
                        <li><a href="/tea/show">教师管理</a></li>
                        <li><a href="/task/show">安排教师到某个班级上某门课-有点难</a></li>
                    </ul>
                </div >
            </div>
            <!--管理员窗口结束-->


            <!--教师窗口-->
            <div  align="center" >
                <h3>教师端-教师登录后方可操作</h3>
                <div th:if="${ session.user!= null &&  session.user.role=='tea'}">

                    <ul style="list-style: square">
                        <li><a href="/mark5/go2updpwd">修改密码</a></li>
                        <li><a href="/t_tea/findMyteask">登分管理-难</a></li>
                    </ul>
                </div>
            </div>
            <!--教师窗口结束-->

            <!-- 学生窗口-->
            <div   align="center" >
                <h3>学生端-学生登录后方可操作</h3>
                <div th:if="${ session.user!= null && session.user.role=='stu'}">
                    <ul style="list-style: square">
                        <li><a href="/mark5/go2updpwd">修改密码</a></li>
                        <li><a href="/s_stu/findCourse">我的课程查询-我所在班级的课程表</a></li>
                        <li><a href="/s_stu/findMyMark">我的成绩查询 - 有点难</a></li>
                    </ul>
                </div>
            </div>
            <!-- 学生窗口结束-->



        </div>
        <!--功能窗口结束-->
    </div>
    <!--登录窗口及功能窗口-->
</div>
</body>
</html>
</body>
</html>